package com.lovo.test.ATM;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

//查询界面
public class CheckPanel extends JPanel implements ActionListener {
    private JLabel userLabel;
    private JLabel pwdLabel;


    private JButton returnBut;//返回按钮
    private ATM frame;

    public CheckPanel(ATM frame){
        this.frame=frame;

        //空布局
        this.setLayout(null);
        //设置透明
        this.setOpaque(false);

        //返回按钮,返回菜单界面
        returnBut = new JButton("返回");
        returnBut.setBounds(350,280,100,50);
        this.add(returnBut);
        returnBut.addActionListener(this);

        //以下是标签
        userLabel = new JLabel();
        userLabel.setBounds(350,170,100,20);
        add(userLabel);

        pwdLabel = new JLabel();
        pwdLabel.setBounds(350,200,100,20);
        add(pwdLabel);

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==returnBut){
            frame.switchPanel("菜单");
        }

    }

   //下面是get。set

    public JLabel getUserLabel() {
        return userLabel;
    }

    public void setUserLabel(JLabel userLabel) {
        this.userLabel = userLabel;
    }

    public JLabel getPwdLabel() {
        return pwdLabel;
    }

    public void setPwdLabel(JLabel pwdLabel) {
        this.pwdLabel = pwdLabel;
    }
}
